package com.best.onegous.details;

import java.util.ArrayList;
import java.util.List;

import org.json.JSONObject;

import com.best.onegous.BaseActivity;
import com.best.onegous.R;
import com.best.onegous.Adapter.MyShaiDanAdapter;
import com.best.onegous.Adapter.Order_leftAdapter;
import com.best.onegous.Refresh.XListView;
import com.best.onegous.Refresh.XListView.IXListViewListener;

import android.os.Bundle;
import android.os.Handler;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.TextView;

public class MyShaiDan  extends BaseActivity implements OnClickListener,IXListViewListener{
	private XListView mListView;
	private List<JSONObject> mDatas = new ArrayList<JSONObject>();
	private MyShaiDanAdapter mAdapter;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		setThem(R.layout.myshaidan_activity);
		findViewById(R.id.back).setOnClickListener(this);
		mListView = (XListView) findViewById(R.id.listview);
		
		
		mAdapter = new MyShaiDanAdapter(this, mDatas);
		mListView.setAdapter(mAdapter);
		mListView.setPullRefreshEnable(true);
		mListView.setPullLoadEnable(true);
		mListView.setXListViewListener(this);
	}
	@Override
	public void onClick(View v) {
		// TODO Auto-generated method stub
		switch (v.getId()) {
		case R.id.back:
			 finish();
			break;

		}
	}
	@Override
	public void onLoadMore() {
		// TODO Auto-generated method stub
		Handler handler = new Handler();
		handler.postDelayed(new Runnable() {
			@Override
			public void run() {
				mListView.stopLoadMore();
			}
		}, 2000);
	}

	@Override
	public void onRefresh() {
		// TODO Auto-generated method stub
		Handler handler = new Handler();
		handler.postDelayed(new Runnable() {
			@Override
			public void run() {
				mListView.stopRefresh();
			}
		}, 2000);
	}
}
